/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dados;

import java.util.Date;
import net.sourceforge.floggy.persistence.FloggyException;
import net.sourceforge.floggy.persistence.Persistable;
import net.sourceforge.floggy.persistence.PersistableManager;

/**
 *
 * @author Glaucio
 */
public class Lancamento implements Persistable {

  private Conta conta;
  private Date data;
  private double valor;
  private String Complemento;

  public Lancamento() {
  }

  public void save() {
    try {
      PersistableManager pm = PersistableManager.getInstance();
      pm.setProperty(PersistableManager.STORE_INDEX_AFTER_SAVE_OPERATION, Boolean.TRUE);
      pm.save(this);
      //pm.shutdown();
    } catch (FloggyException ex) {
      ex.printStackTrace();
    }
  }

  /**
   * @return the conta
   */
  public Conta getConta() {
    return conta;
  }

  /**
   * @param conta the conta to set
   */
  public void setConta(Conta conta) {
    this.conta = conta;
  }

  /**
   * @return the data
   */
  public Date getData() {
    return data;
  }

  /**
   * @param data the data to set
   */
  public void setData(Date data) {
    this.data = data;
  }

  /**
   * @return the valor
   */
  public double getValor() {
    return valor;
  }

  /**
   * @param valor the valor to set
   */
  public void setValor(double valor) {
    this.valor = valor;
  }

  /**
   * @return the Complemento
   */
  public String getComplemento() {
    return Complemento;
  }

  /**
   * @param Complemento the Complemento to set
   */
  public void setComplemento(String Complemento) {
    this.Complemento = Complemento;
  }
}
